<template>
  <div id="app">
      <back />
    <div class="search">
      <input type="text" v-model="sou" />
      <span @click="onsearch">搜索</span>
    </div>
  </div>
</template>

<script>
import { search } from "../utils/api";
import back from "../components/back.vue";
export default {
  components: {
    back,
  },
  data() {
    return {
      sou: "",
    };
  },
  methods: {
    onsearch() {
      search(this.$data).then((res) => {
        if (res.data.code == 200) {
          console.log(res);
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
#app {
  position: relative;
  .tu {
    width: 332px;
    height: 32px;
    background-color: pink;
  }
  .search {
    width: 240px;
    height: 24px;
    position: absolute;
    left: 45px;
    top: 13px;
    background-color: #f1f1f2;
    input {
      border: 0;
      background-color: #f1f1f2;
    }
  }
}
</style>>
